package com.lc.utils;

import com.cnpc.framework.base.utils.HttpClient;
import com.cnpc.framework.utils.PropertiesUtil;

import java.util.Map;

public class TXPostUtils {

    public static String BAIDU_URL_PROFIX = "https://apis.map.qq.com/ws";

    public static <T> T  post(String url, Map<String, Object> params, Class<T> clazz)throws Exception{
        url = BAIDU_URL_PROFIX+url;
        params.put("key", PropertiesUtil.getValue("tx.key"));
        return HttpClient.restTemplatePost(url,params,clazz);
    }



    public static <T> T  get(String url, Map<String, Object> params, Class<T> clazz) throws Exception{
        url = BAIDU_URL_PROFIX+url;
        params.put("key", PropertiesUtil.getValue("tx.key"));
        return HttpClient.restTemplateGet(url,params,clazz);
    }

}
